import { Model, DataTypes } from 'sequelize'
import { sequelize } from '../db/sequelize.js'

class Blog extends Model { }
Blog.init(
    {
        title: {
            type: DataTypes.STRING,
            allowNull: false
        },
        author: {
            type: DataTypes.STRING,
            allowNull: false,
        },
        publishedTime: {
            type: DataTypes.DATE
        },
        description: {
            type: DataTypes.STRING,
            allowNull: true
        }
    },
    { sequelize, modelName: 'Blog' }
);

export default Blog